<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

    <script type="text/javascript" src="<%=request.getContextPath()%>/js/eqpt/tabPage.js"></script>

    <title>任务管理 - 清管管理</title>
    <style>
        td li{position: relative !important;width:100% !important;height:40px}
        .edit_00 {
            display: inline-block;
            width: 25px;
            height: 25px;
            vertical-align: -8px;
            background: url("${resourcePath}images/pig/icon_edit.png") no-repeat center center;
            position:absolute;
            left:50%;
            margin-left:-13px !important;
            top:50% ;
            margin-top:-12px;
        }
        .edit_00:hover{border-radius: 50%;
            background: url("${resourcePath}images/pig/icon_edit_white.png") no-repeat center center}


        .public_00 {
            display: inline-block;
            width: 25px;
            height: 25px;
            vertical-align: -7px;
            background: url("${resourcePath}images/pig/icon_release.png") no-repeat center center;
            left:50%;
            position:absolute;
            margin-left:-13px !important;
            top:50% ;
            margin-top:-12px;
        }
        .public_00:hover{    border-radius: 50%;
            background: url("${resourcePath}images/pig/icon_release_white.png") no-repeat center center}

        .download_00 {
            display: inline-block;
            width: 24px;
            height: 24px;
            position:absolute;
            vertical-align: -9px;
            background: url("${resourcePath}images/pig/icon_enclosure.png") no-repeat center center;
            left:50%;
            margin-left:-13px !important;
            top:50% ;
            margin-top:-12px;
        }
        .over{width:85%;text-overflow: ellipsis;overflow:hidden;white-space: nowrap}
        .download_00:hover{    border-radius: 50%;
            background:  url("${resourcePath}images/pig/icon_enclosure_white.png") no-repeat center center;}
        <%--.download_00:hover{--%>
            <%--border-radius:80px; background:url("${resourcePath}images/comm/download_hover.png") #F95F5F no-repeat center center;--%>
        <%--}--%>
        <%--.edit_00:hover {--%>
            <%--border-radius: 80px; background: url("${resourcePath}/images/comm/editt-hover.png") no-repeat center center;--%>
        <%--}--%>
        <%--.public_00:hover {--%>
            <%--border-radius: 80px; background: url("http://192.168.2.50:7226/ui/default//images/insp/Send_hover.png") #ffae00 no-repeat center center;--%>
        <%--}--%>
    </style>

</head>
<body class="body-pad" style="background-color:#eceff4">
<input type="hidden" id="pagePath" value="${pageContext.request.contextPath}"/>
<input type="hidden" id="resourcePath" value="${resourcePath}"/>
<!-- content-body -->
<!--rightBar Begin-->

<div class="html-header" style="background-color:white;padding-top:0">
    <p class="header-title" style="margin-top:0"><em class="icon-jcrw1"></em>任务管理</p>
</div>
<div class="container-fluid warp insp-container" search="<%=request.getContextPath()%>/pig/cleanPipeLineManager/getCleanPipeLineManagerIndex.json" init="true" >
    <div class="row-fluid  bg-white1">
        <div class="main clearFix">
            <div class="cxtj clearFix">
                <div class="fxgl">
                    <p class="fxgl-title">任务名称</p>
                    <div >
                        <div class="zy-input-inner" style="border-radius:0;border:none">
                            <input type="text" class="zy-i-input"  id="searchModelNumber" data-name="taskName" style="height:38px;width:100%;border:1px solid #dfe5fa;border-radius:0"/>
                        </div>
                    </div>
                </div>
                <div class="fxgl">
                    <p class="fxgl-title">管道名称</p>
                    <%--<div class="sel w320">
                        <div class="dropdown-list sel w320" data-name="baseline" alias="lineId">
                            <div class="drop-list drop-list-min">
                                <div class="checked">
                                    <a href="javascript:void(0);">全部管道</a>
                                </div>
                                <span class="down-span"></span>
                            </div>
                            <ul class="select select-min none">

                            </ul>
                        </div>
                    <%--</div>--%>
                    <div class="zy-select-inner">
                        <blockquote id="JQ_pipeline" class="bk-select" alias="lineId"><abbr></abbr></blockquote>
                    </div>
                </div>
                <div class="fxgl br">
                    <p class="fxgl-title">管段名称</p>
                    <%--<div class="sel w320">
                        <div class="dropdown-list sel w320" data-name="baseSegment"  alias="segmentId">
                            <div class="drop-list drop-list-min">
                                <div class="checked">
                                    <a href="javascript:void(0);">全部管段</a>
                                </div>
                                <span class="down-span"></span>
                            </div>
                            <ul class="select select-min none">

                            </ul>
                        </div>
                    </div>--%>
                    <div class="zy-select-inner">
                        <blockquote id="JQ_segment" class="bk-select" ></blockquote>
                    </div>
                </div>
                <div class="fxgl" style="margin-top:10px">
                    <p class="fxgl-title">起点位置</p>
                    <%--<div class="sel w320">--%>
                    <div class="zy-select-inner">
                        <blockquote id="JQ_begin" class="bk-select" alias="fromValId"></blockquote>
                    </div>
                    <%--</div>--%>
                </div>
                <div class="fxgl" style="margin-top:10px">
                    <p class="fxgl-title">终点位置</p>
                    <%--<div class="sel w320">--%>
                    <div class="zy-select-inner">
                        <blockquote id="JQ_end" class="bk-select"  alias="toValId"></blockquote>
                    </div>
                    <%--</div>--%>
                </div>
                <div style="clear:both"></div>
                <div class="fd1">
                    <a href="javascript:;" class="btn btn-w130 btn-search-icon btn-h40 search"
                       style="float:left;margin-top:20px"><em></em>查询</a>
                </div>
                <p class="tool pad20" >
                    <a class="btn btn-w72 btn-add-icon btn-h30 " onclick="getAddOrModify('add')" href="javascript:;"><em></em>新建</a>
                    <a href="javascript:;"  class="btn btn-w72 btn-copy-icon btn-h30 copyBtn" ><em></em>复制</a>
                    <a href="javascript:;" class="btn btn-w72 btn-del-icon btn-h30 delAll" onclick="deleteFun('mutiCheck');"><em></em>删除</a>
                    <a href="javascript:;" class="btn btn-w72 btn-public-icon btn-h30 sendAll" onclick="publishFun('mutiCheck');"><em></em>发布</a>
                </p>
                <div style="clear: both"></div>
                <div class="l-r clearFix pad20" style="margin-top:5px">
                    <div class="left tabBox" >

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--复制弹出层-->
<div id="copycccc" url="<%=request.getContextPath()%>/pig/cleanPipeLineManager/copySave.json" class="modal hide fade" tabindex="9999" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
     style="width:820px;margin-left:-410px;height:480px;margin-top:-240px;top:50%">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h3 class="PopupTitle" style="text-align:center">复制任务</h3>
        <input  data-name="ID" type="hidden"/>

        <input  data-name="FROMPIGID" type="hidden"/>
        <input  data-name="TOPIGID" type="hidden"/>


    </div>
    <div class="modal-body copy-tan" style="height:355px">
        <ul class="ul-title">
            <li>任务名称</li>
            <li>管道名称</li>
            <li class="no-r">清管类型</li>
        </ul>
        <ul class="u-info">
            <li class="li1">
                <%--<span class="s1" show-data="TASKNAME">智能检测清管</span>--%>
                <input id="copyTaskName" data-name="TASKNAME" type="text" style="border:none;height:38px"/>
            </li>
            <li class="li1" show-data="LINENAME">
            </li>
            <li class="no-r li1" >
                <span class="s1" show-data="TYPESTR"></span>
            </li>
        </ul>
        <div style="clear: both"></div>
        <div class="sel" style="width:100%;float:left;height:40px;margin-bottom:0">
            <div class="xs-sf" style="width:30.6%">
                <em class="fa"><img src="${resourcePath}images/comm/fa.png" alt=""/></em><span id="copyFromPig" show-data="FROMPIG"  class="over" title=""></span>
            </div>
            <div class="xs-sf" style="margin-left:30px;width:30.6%">
                <em class="fa"><img src="${resourcePath}images/comm/shou.png" alt=""/></em><span id="copyToPig"  show-data="TOPIG" class="over" title=""></span>
            </div>
            <script>
                $('.xs-sf span').attr({"title":$(this).html()})
            </script>
        </div>
        <div style="clear: both"></div>
        <ul class="ul-title">
            <li>清管工具</li>
            <li>计划实施时间</li>
        </ul>
        <div style="clear: both"></div>
        <ul class="u-info">
            <li class="li1" style="border-bottom:none">
                <div class="sel  clearFix" style="width:100%;position:relative;margin-top:10px">
                    <div class="dropdown-list" data-name="DETECTOR_TYPE" init="false" code="DETECTOR_TYPE">
                        <div class="drop-list drop-list-min">
                            <div class="checked" id="copyPigType">
                                <a href="javascript:void(0);">清管工具</a>
                            </div>
                            <span class="down-span"></span>
                        </div>
                        <ul class="select select-min none" style="height:155px;overflow:auto">

                        </ul>
                    </div>
                </div>
            </li>
            <li class=" li1 insp-container" style="border-bottom:none">
                <div class="sel" style="width:100%;height:40px">
                        <span class="time"><input id="copyPlanTime" data-name="planTime" onclick="laydate({format: 'YYYY-MM-DD'})" class="laydate-icon" style="width:92%"/></span>
                </div>
            </li>
        </ul>

        <p style="clear:both"></p>
        <p class="qg-text" style="margin-top:15px"><textarea rows="" data-name="remark" cols="" id="copyRemark" placeholder="请输入备注"></textarea></p>
    </div>
    <div class="modal-footer" style="text-align:center">
        <button class="btn btn-w140 btn-print-icon btn-h40 save" id="ddd">确认</button>
    </div>
</div>

<script type="text/javascript" src="<%=request.getContextPath()%>/js/pig/cleanPipeLineManager.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/pig/pig.js"></script>
<!-- ui -->
<script src="<%=request.getContextPath()%>/static/js/ui/ui-main.js"></script>
<script>

    // 管道
    var $pipeline = $('#JQ_pipeline').select3();
    // 管段
    var $segment = $('#JQ_segment').select3({
        title:'管段'
    });
    // 起点位置
    var $begin = $('#JQ_begin').select3({
        title: '起点位置',
        server: true,
        param: {'pipeLineId':$pipeline,'pipeSegmentId':$segment}
    });
    // 终点位置
    var $end = $('#JQ_end').select3({
        title:'终点位置',
        server: true,
        param: {'pipeLineId':$pipeline,'pipeSegmentId':$segment,'beginSignId':$begin}
    });

    // 触发管道
    $pipeline.element.on('select',function(e,v){
        var id = v || $pipeline.val();
        if(id){
            // 管段
            DyyBase.ajax(DyyBase.url_segment(), {pipeLineId:id}, function(dataset){
                var json = DyyBase.getSelect(dataset);
                $segment.add(json);
            });
            // 起点 & 终点
            DyyBase.ajax(DyyBase.url_pipe_pos(), {pipeLineId:id}, function(dataset){
                var begin = DyyBase.getPos(dataset,'begin');
                var end = DyyBase.getPos(dataset,'end');
                $begin.asset(begin);
                $end.asset(end);
            });
        }else{
            $segment.add([]);
            $begin.add([]);
            $end.add([]);
        }
    });
    // 触发管段
    $segment.element.on('select',function(e,v){
        var pipeId = $pipeline.val();
        var id = v || $segment.val();
        if(id){
            // 起点 & 终点
            DyyBase.ajax(DyyBase.url_segment_pos(), {pipeSegmentId:id}, function(dataset){
                var begin = DyyBase.getPos(dataset,'begin');
                var end = DyyBase.getPos(dataset,'end');
                $begin.asset(begin);
                $end.asset(end);
            });
        }else{
            $begin.add([]);
            $end.add([]);
        }
    });

</script>
</body>
</html>